home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / ATA.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  53.1 KB  |  926 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        ATA.a
  3. ;
  4. ;    Contains:    ATA (PC/AT Attachment) Interfaces
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1995-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__ATA__') = 'UNDEFINED' THEN
  19. __ATA__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  25.     include 'MixedMode.a'
  26.     ENDIF
  27.  
  28.  
  29. ;  This is the structure used for the AT Interface core routines below 
  30.  
  31. kATATrap                        EQU        $AAF1                ; Manager trap number <This should be defined in Traps.h>
  32. kATAPBVers1                        EQU        $01                    ; parameter block version number 1
  33. kATAPBVers2                        EQU        $02                    ; parameter block version number for structures
  34. kATAPBVers3                        EQU        $03                    ; parameter block version for ATA times
  35. kATADefaultBlockSize            EQU        512                    ; default block size
  36. ;  Used to determine the presence of traps
  37.  
  38. kFSMTrap                        EQU        $AC
  39. mDQEChanged                        EQU        1                    ; DQE has changed 
  40. ;  Task file definition ••• Error Register •••
  41.  
  42. bATABadBlock                    EQU        7                    ; bit number of bad block error bit
  43. bATAUncorrectable                EQU        6                    ; bit number of uncorrectable error bit
  44. bATAMediaChanged                EQU        5                    ; bit number of media changed indicator
  45. bATAIDNotFound                    EQU        4                    ; bit number of ID not found error bit
  46. bATAMediaChangeReq                EQU        3                    ; bit number of media changed request
  47. bATACommandAborted                EQU        2                    ; bit number of command abort bit
  48. bATATrack0NotFound                EQU        1                    ; bit number of track not found
  49. bATAAddressNotFound                EQU        0                    ; bit number of address mark not found
  50. mATABadBlock                    EQU        $80                    ; Bad Block Detected
  51. mATAUncorrectable                EQU        $40                    ; Uncorrectable Data Error
  52. mATAMediaChanged                EQU        $20                    ; Media Changed Indicator (for removable)
  53. mATAIDNotFound                    EQU        $10                    ; ID Not Found
  54. mATAMediaChangeReq                EQU        $08                    ; Media Change Requested (NOT IMPLEMENTED)
  55. mATACommandAborted                EQU        $04                    ; Aborted Command
  56. mATATrack0NotFound                EQU        $02                    ; Track 0 Not Found
  57. mATAAddressNotFound                EQU        $01                    ; Address Mark Not Found
  58. ;  Task file definition ••• Features register •••
  59.  
  60. bATAPIuseDMA                    EQU        0                    ; bit number of useDMA bit (ATAPI)
  61. mATAPIuseDMA                    EQU        $01
  62. ;  Task file definition ••• ataTFSDH Register •••
  63.  
  64. mATAHeadNumber                    EQU        $0F                    ; Head Number (bits 0-3) 
  65. mATASectorSize                    EQU        $A0                    ; bit 7=1; bit 5 = 01 (512 sector size) <DP4>
  66. mATADriveSelect                    EQU        $10                    ; Drive (0 = master, 1 = slave) 
  67. mATALBASelect                    EQU        $40                    ; LBA mode bit (0 = chs, 1 = LBA)
  68. ;  Task file definition ••• Status Register •••
  69.  
  70. bATABusy                        EQU        7                    ; bit number of BSY bit
  71. bATADriveReady                    EQU        6                    ; bit number of drive ready bit
  72. bATAWriteFault                    EQU        5                    ; bit number of write fault bit
  73. bATASeekComplete                EQU        4                    ; bit number of seek complete bit
  74. bATADataRequest                    EQU        3                    ; bit number of data request bit
  75. bATADataCorrected                EQU        2                    ; bit number of data corrected bit
  76. bATAIndex                        EQU        1                    ; bit number of index mark
  77. bATAError                        EQU        0                    ; bit number of error bit
  78. mATABusy                        EQU        $80                    ; Unit is busy
  79. mATADriveReady                    EQU        $40                    ; Unit is ready
  80. mATAWriteFault                    EQU        $20                    ; Unit has a write fault condition
  81. mATASeekComplete                EQU        $10                    ; Unit seek complete
  82. mATADataRequest                    EQU        $08                    ; Unit data request
  83. mATADataCorrected                EQU        $04                    ; Data corrected
  84. mATAIndex                        EQU        $02                    ; Index mark - NOT USED
  85. mATAError                        EQU        $01                    ; Error condition - see error register
  86. ;  Task file definition ••• Device Control Register •••
  87.  
  88. bATADCROne                        EQU        3                    ; bit number of always one bit
  89. bATADCRReset                    EQU        2                    ; bit number of reset bit
  90. bATADCRnIntEnable                EQU        1                    ; bit number of interrupt disable
  91. mATADCROne                        EQU        $08                    ; always one bit
  92. mATADCRReset                    EQU        $04                    ; Reset (1 = reset)
  93. mATADCRnIntEnable                EQU        $02                    ; Interrupt Disable(0 = enabled)
  94. ;  ATA Command Opcode definition
  95.  
  96. kATAcmdWORetry                    EQU        $01                    ; Without I/O retry option
  97. kATAcmdNOP                        EQU        $0000                ; NOP operation - media detect
  98. kATAcmdRecal                    EQU        $0010                ; Recalibrate command 
  99. kATAcmdRead                        EQU        $0020                ; Read command 
  100. kATAcmdReadLong                    EQU        $0022                ; Read Long command
  101. kATAcmdWrite                    EQU        $0030                ; Write command 
  102. kATAcmdWriteLong                EQU        $0032                ; Write Long
  103. kATAcmdWriteVerify                EQU        $003C                ; Write verify
  104. kATAcmdReadVerify                EQU        $0040                ; Read Verify command 
  105. kATAcmdFormatTrack                EQU        $0050                ; Format Track command 
  106. kATAcmdSeek                        EQU        $0070                ; Seek command 
  107. kATAcmdDiagnostic                EQU        $0090                ; Drive Diagnostic command 
  108. kATAcmdInitDrive                EQU        $0091                ; Init drive parameters command 
  109. kATAcmdReadMultiple                EQU        $00C4                ; Read multiple
  110. kATAcmdWriteMultiple            EQU        $00C5                ; Write multiple
  111. kATAcmdSetRWMultiple            EQU        $00C6                ; Set Multiple for Read/Write Multiple
  112. kATAcmdReadDMA                    EQU        $00C8                ; Read DMA (with retries)
  113. kATAcmdWriteDMA                    EQU        $00CA                ; Write DMA (with retries)
  114. kATAcmdMCAcknowledge            EQU        $00DB                ; Acknowledge media change - removable
  115. kATAcmdDoorLock                    EQU        $00DE                ; Door lock
  116. kATAcmdDoorUnlock                EQU        $00DF                ; Door unlock
  117. kATAcmdStandbyImmed                EQU        $00E0                ; Standby Immediate
  118. kATAcmdIdleImmed                EQU        $00E1                ; Idle Immediate
  119. kATAcmdStandby                    EQU        $00E2                ; Standby
  120. kATAcmdIdle                        EQU        $00E3                ; Idle
  121. kATAcmdReadBuffer                EQU        $00E4                ; Read sector buffer command 
  122. kATAcmdCheckPowerMode            EQU        $00E5                ; Check power mode command    <04/04/94>
  123. kATAcmdSleep                    EQU        $00E6                ; Sleep
  124. kATAcmdWriteBuffer                EQU        $00E8                ; Write sector buffer command 
  125. kATAcmdWriteSame                EQU        $00E9                ; Write same data to multiple sectors
  126. kATAcmdDriveIdentify            EQU        $00EC                ; Identify Drive command 
  127. kATAcmdMediaEject                EQU        $00ED                ; Media Eject
  128. kATAcmdSetFeatures                EQU        $00EF                ; Set Features
  129. ;  Set feature command opcodes
  130.  
  131. kATAEnableWriteCache            EQU        $02                    ;        Enable write cache
  132. kATASetTransferMode                EQU        $03                    ;        Set transfer mode
  133. kATASetPIOMode                    EQU        $08                    ;        PIO Flow Control Tx Mode bit
  134. kATAEnableECC                    EQU        $88                    ;        ECC enable
  135. kATAEnableRetry                    EQU        $99                    ;        Retry enable
  136. kATAEnableReadAhead                EQU        $AA                    ;        Read look-ahead enable
  137.  
  138. ;  --------------------------------------------------------------------------------
  139. ;   enums for dealing with device IDs
  140.  
  141.  
  142.  
  143.  
  144. kATABusIDMask                    EQU        $000000FF
  145. kATADeviceIDMask                EQU        $0000FF00
  146. kATADeviceIDClippingMask        EQU        $0000FFFF
  147. kMinBusID                        EQU        $00000000
  148. kMaxBusID                        EQU        $000000FE
  149.  
  150. kATAStartIterateDeviceID        EQU        $FFFF
  151. kATAEndIterateDeviceID            EQU        $FF
  152. ; --------------------------------------------------------------------------------
  153. ;  Device Register Images  (8 bytes) 
  154. ataTaskFile                RECORD 0
  155. ataTFFeatures             ds.b    1                ; offset: $0 (0)        ;  <-> Error(R) or ataTFFeatures(W) register image 
  156. ataTFCount                 ds.b    1                ; offset: $1 (1)        ;  <-> Sector count/remaining 
  157. ataTFSector                 ds.b    1                ; offset: $2 (2)        ;  <-> Sector start/finish 
  158. ataTFReserved             ds.b    1                ; offset: $3 (3)        ;  reserved                    
  159. ataTFCylinder             ds.w    1                ; offset: $4 (4)        ;  <-> ataTFCylinder (Big endian) 
  160. ataTFSDH                 ds.b    1                ; offset: $6 (6)        ;  <-> ataTFSDH register image
  161. ataTFCommand             ds.b    1                ; offset: $7 (7)        ;  <-> Status(R) or Command(W) register image 
  162. sizeof                     EQU *                    ; size:   $8 (8)
  163.                         ENDR
  164. ;  ATA Manager Function Code Definition
  165.  
  166. kATAMgrNOP                        EQU        $00                    ; No Operation
  167. kATAMgrExecIO                    EQU        $01                    ; Execute ATA I/O
  168. kATAMgrBusInquiry                EQU        $03                    ; Bus Inquiry
  169. kATAMgrQRelease                    EQU        $04                    ; I/O Queue Release
  170. kATAMgrAbort                    EQU        $10                    ; Abort command
  171. kATAMgrBusReset                    EQU        $11                    ; Reset ATA bus
  172. kATAMgrRegAccess                EQU        $12                    ; Register Access
  173. kATAMgrDriveIdentify            EQU        $13                    ; Drive Identify            <DP03/10/94>
  174. kATAMgrDriverLoad                EQU        $82                    ; Load driver from either Media, ROM, etc.
  175. kATAMgrDriveRegister            EQU        $85                    ; Register a driver        <4/18/94>
  176. kATAMgrFindDriverRefnum            EQU        $86                    ; lookup a driver refnum    <4/18/94>
  177. kATAMgrRemoveDriverRefnum        EQU        $87                    ; De-register a driver    <4/18/94>
  178. kATAMgrModifyEventMask            EQU        $88                    ; Modify driver event mask
  179. kATAMgrDriveEject                EQU        $89                    ; Eject the drive        <8/1/94>
  180. kATAMgrGetDrvConfiguration        EQU        $8A                    ; Get device configuration    <8/6/94>
  181. kATAMgrSetDrvConfiguration        EQU        $8B                    ; Set device configuration <8/6/94>
  182. kATAMgrGetLocationIcon            EQU        $8C                    ; Get card location icon    <SM4>
  183. kATAMgrManagerInquiry            EQU        $90                    ; Manager Inquiry
  184. kATAMgrManagerInit                EQU        $91                    ; Manager initialization
  185. kATAMgrManagerShutdown            EQU        $92                    ; Manager ShutDown
  186.                                                             ; note: functions 0x93 to 0x97 are reserved
  187. kATAMgrFindSpecialDriverRefnum    EQU        $98                    ; lookup a driver refnum; driverloader,notify-all or ROM driver.
  188. kATAMgrNextAvailable            EQU        $99
  189. ;  used in the ataDrvrFlags field for kATAMgrDriveRegister,kATAMgrRemoveDriverRefnum & kATAMgrFindSpecialDriverRefnum
  190.  
  191. kATANotifyAllDriver                EQU        0                    ; Notify-All driver
  192. kATADriverLoader                EQU        1                    ; Driver loader driver        
  193. kATAROMDriver                    EQU        2                    ; ROM driver
  194. ;  'ATAFlags' field of the PB header definition
  195.  
  196. bATAFlagUseConfigSpeed            EQU        15                    ; bit number of use default speed flag
  197. bATAFlagByteSwap                EQU        14                    ; bit number of byte swap flag
  198. bATAFlagIORead                    EQU        13                    ; bit number of I/O read flag
  199. bATAFlagIOWrite                    EQU        12                    ; bit number of I/O write flag
  200. bATAFlagImmediate                EQU        11                    ; bit number of immediate flag
  201. bATAFlagQLock                    EQU        10                    ; bit number of que lock on error
  202. bATAFlagScatterGather1            EQU        9                    ; bit number of scatter gather
  203. bATAFlagScatterGather0            EQU        8                    ; bit numbers of scatter gather
  204. bATAFlagUseDMA                    EQU        7                    ; bit number of use DMA flag
  205. bATAFlagProtocol1                EQU        5                    ; bit number of scatter gather
  206. bATAFlagProtocol0                EQU        4                    ; bit numbers of protocol specifier
  207. bATAFlagTFRead                    EQU        3                    ; bit number of register update
  208. bATAFlagLEDEnable                EQU        0                    ; bit number of LED enable
  209. mATAFlagUseConfigSpeed            EQU        $8000
  210. mATAFlagByteSwap                EQU        $4000                ; Swap data bytes (read - after; write - before)
  211. mATAFlagIORead                    EQU        $2000                ; Read (in) operation
  212. mATAFlagIOWrite                    EQU        $1000                ; Write (out) operation
  213. mATAFlagImmediate                EQU        $0800                ; Head of Que; Immediate operation
  214. mATAFlagQLock                    EQU        $0400                ; Manager queue lock on error (freeze the queue)
  215. mATAFlagScatterGather1            EQU        $0200
  216. mATAFlagScatterGather0            EQU        $0100                ; Scatter gather enable
  217. mATAFlagScatterGathers            EQU        $0300                ; host scatter gather type = currently type 1 supported
  218. mATAFlagUseDMA                    EQU        $80
  219. mATAFlagProtocol1                EQU        $20                    ; ATAPI protocol indicator <06/15/94>
  220. mATAFlagProtocol0                EQU        $10                    ; PCMCIA protocol indicator <06/15/94>
  221. mATAFlagProtocols                EQU        $30                    ; mask for protocol type field    <06/15/94>
  222. mATAFlagTFRead                    EQU        $08                    ; update reg block request upon detection of an error
  223. mATAFlagLEDEnable                EQU        $01                    ; socket LED enable
  224.  
  225. ataPBHeader                RECORD 0
  226. ;  Start of cloned common header ataPBHdr 
  227. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  228. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  229. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number
  230. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  231. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  232. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  233. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  234. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  235. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  236. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  237. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  238. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  239. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  240. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  241. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  242. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  243. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  244. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  245. ;  End of cloned common header ataPBHdr
  246. sizeof                     EQU *                    ; size:   $30 (48)
  247.                         ENDR
  248. ;  data request entry structure (16 bytes)
  249. IOBlock                    RECORD 0
  250. ataPBBuffer                 ds.l    1                ; offset: $0 (0)        ;  -->: Data buffer pointer
  251. ataPBByteCount             ds.l    1                ; offset: $4 (4)        ;  -->: Data transfer length in bytes
  252. sizeof                     EQU *                    ; size:   $8 (8)
  253.                         ENDR
  254.  
  255. ;   For ATAPI devices the ExtendedPB field is a pointer to the Command Packet
  256. ;   record which exists of an array of words structured as follows…    <06/15/94>
  257.  
  258.  
  259. ATAPICmdPacket            RECORD 0
  260. atapiPacketSize             ds.w    1                ; offset: $0 (0)        ;  Size of command packet in bytes    <06/15/94>
  261. atapiCommandByte         ds.w    8                ; offset: $2 (2)        ;  The command packet itself    <06/15/94>
  262. sizeof                     EQU *                    ; size:   $12 (18)
  263.                         ENDR
  264. ;  Manager parameter block structure (96 bytes)
  265. ataIOPB                    RECORD 0
  266. ;  Start of cloned common header ataPBHdr
  267. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  268. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  269. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  270. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  271. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  272. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  273. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  274. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  275. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  276. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  277. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  278. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  279. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  280. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  281. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  282. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  283. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  284. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  285. ;  End of cloned common header ataPBHdr
  286. ataPBStatusRegister         ds.b    1                ; offset: $30 (48)        ;  <--: Last ATA status image
  287. ataPBErrorRegister         ds.b    1                ; offset: $31 (49)        ;  <--: Last ATA error image-valid if lsb of Status set
  288. ataPBReserved5             ds.w    1                ; offset: $32 (50)        ;  Reserved
  289. ataPBLogicalBlockSize     ds.l    1                ; offset: $34 (52)        ;  -->: Blind transfer size per interrupt (Logical block size)
  290. ataPBBuffer                 ds.l    1                ; offset: $38 (56)        ;  -->: Data buffer pointer
  291. ataPBByteCount             ds.l    1                ; offset: $3C (60)        ;  -->: Data transfer length in bytes
  292. ataPBActualTxCount         ds.l    1                ; offset: $40 (64)        ;  <--: Actual transfer count
  293. ataPBReserved6             ds.l    1                ; offset: $44 (68)        ;  Reserved
  294. ataPBTaskFile             ds        ataTaskFile        ; offset: $48 (72)        ;  <->:    Device register images
  295. ataPBPacketPtr             ds.l    1                ; offset: $50 (80)        ;  -->: ATAPI packet command block pointer (valid with ATAPI bit set)
  296. ataPBReserved7             ds.w    6                ; offset: $54 (84)        ;  Reserved for future expansion
  297. sizeof                     EQU *                    ; size:   $60 (96)
  298.                         ENDR
  299. ;  Parameter block structure for bus and Manager inquiry command
  300. ;  Manager parameter block structure
  301. ataBusInquiry            RECORD 0
  302. ;  Start of cloned common header ataPBHdr
  303. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  304. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  305. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  306. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  307. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  308. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  309. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  310. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  311. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  312. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  313. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  314. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  315. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  316. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  317. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  318. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  319. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  320. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  321. ;  End of cloned common header ataPBHdr
  322. ataEngineCount             ds.w    1                ; offset: $30 (48)        ;  <--: TBD; zero for now
  323. ataReserved1             ds.w    1                ; offset: $32 (50)        ;  Reserved
  324. ataDataTypes             ds.l    1                ; offset: $34 (52)        ;  <--: TBD; zero for now
  325. ataIOpbSize                 ds.w    1                ; offset: $38 (56)        ;  <--: Size of ATA IO PB
  326. ataMaxIOpbSize             ds.w    1                ; offset: $3A (58)        ;  <--: TBD; zero for now
  327. ataFeatureFlags             ds.l    1                ; offset: $3C (60)        ;  <--: TBD
  328. ataVersionNum             ds.b    1                ; offset: $40 (64)        ;  <--: Version number for the HBA
  329. ataHBAInquiry             ds.b    1                ; offset: $41 (65)        ;  <--: TBD; zero for now
  330. ataReserved2             ds.w    1                ; offset: $42 (66)        ;  Reserved
  331. ataHBAPrivPtr             ds.l    1                ; offset: $44 (68)        ;  <--: Ptr to HBA private data area
  332. ataHBAPrivSize             ds.l    1                ; offset: $48 (72)        ;  <--: Size of HBA private data area
  333. ataAsyncFlags             ds.l    1                ; offset: $4C (76)        ;  <--: Event capability for callback
  334. ataPIOModes                 ds.b    1                ; offset: $50 (80)        ;  <--: PIO modes supported (bit-significant)
  335. ataReserved3             ds.b    1                ; offset: $51 (81)        ;  Reserved
  336. ataSingleDMAModes         ds.b    1                ; offset: $52 (82)        ;  <--: Single Word DMA modes supported (b-sig)    
  337. ataMultiDMAModes         ds.b    1                ; offset: $53 (83)        ;  <--: Multiword DMA modes supported (b-sig)
  338. ataReserved4             ds.l    4                ; offset: $54 (84)        ;  Reserved
  339. ataReserved5             ds.b    16                ; offset: $64 (100)        ;  TBD
  340. ataHBAVendor             ds.b    16                ; offset: $74 (116)        ;  <--: Vendor ID of the HBA
  341. ataContrlFamily             ds.b    16                ; offset: $84 (132)        ;  <--: Family of ATA Controller
  342. ataContrlType             ds.b    16                ; offset: $94 (148)        ;  <--: Model number of controller
  343. ataXPTversion             ds.b    4                ; offset: $A4 (164)        ;  <--: version number of XPT
  344. ataReserved6             ds.b    4                ; offset: $A8 (168)        ;  Reserved
  345. ataHBAversion             ds        NumVersion        ; offset: $AC (172)        ;  <--: version number of HBA
  346. ataHBAslotType             ds.b    1                ; offset: $B0 (176)        ;  <--: type of slot
  347. ataHBAslotNum             ds.b    1                ; offset: $B1 (177)        ;  <--: slot number of the HBA
  348. ataReserved7             ds.w    1                ; offset: $B2 (178)        ;  Reserved
  349. ataReserved8             ds.l    1                ; offset: $B4 (180)        ;  Reserved
  350. sizeof                     EQU *                    ; size:   $B8 (184)
  351.                         ENDR
  352. ;  Manager parameter block structure
  353. ataMgrInquiry            RECORD 0
  354. ;  Start of cloned common header ataPBHdr
  355. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  356. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  357. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  358. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  359. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  360. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  361. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  362. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  363. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  364. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  365. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  366. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  367. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  368. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  369. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  370. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  371. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  372. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  373. ;  End of cloned common header ataPBHdr
  374. ataMgrVersion             ds        NumVersion        ; offset: $30 (48)        ;  Manager Version information
  375. ataMgrPBVers             ds.b    1                ; offset: $34 (52)        ;  <--: Manager PB version number supported
  376. Reserved1                 ds.b    1                ; offset: $35 (53)        ;  Reserved
  377. ataBusCnt                 ds.w    1                ; offset: $36 (54)        ;  <--: Number of ATA buses in the system
  378. ataDevCnt                 ds.w    1                ; offset: $38 (56)        ;  <--: Total number of ATA devices detected
  379. ataPioModes                 ds.b    1                ; offset: $3A (58)        ;  <--: Maximum Programmed I/O speed mode supported
  380. Reserved2                 ds.b    1                ; offset: $3B (59)        ;  Reserved
  381. ataIOClkResolution         ds.w    1                ; offset: $3C (60)        ;  <--: IO Clock resolution in nsec (Not supported)
  382. ataSingleDMAModes         ds.b    1                ; offset: $3E (62)        ;  <--: Single Word DMA modes supported    
  383. ataMultiDMAModes         ds.b    1                ; offset: $3F (63)        ;  <--: Multiword DMA modes supported
  384. Reserved                 ds.w    16                ; offset: $40 (64)        ;  Reserved for future expansion
  385. sizeof                     EQU *                    ; size:   $60 (96)
  386.                         ENDR
  387. ;  Parameter block structure for Abort command
  388. ;  Manager parameter block structure
  389. ataAbort                RECORD 0
  390. ;  Start of cloned common header ataPBHdr
  391. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  392. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  393. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  394. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  395. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  396. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  397. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  398. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  399. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  400. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  401. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  402. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  403. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  404. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  405. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  406. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  407. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  408. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  409. ;  End of cloned common header ataPBHdr
  410. ataAbortPB                 ds.l    1                ; offset: $30 (48)        ;  -->: Parameter block to be aborted
  411. Reserved                 ds.w    22                ; offset: $34 (52)        ;  Reserved for future expansion
  412. sizeof                     EQU *                    ; size:   $60 (96)
  413.                         ENDR
  414. ;  Manager parameter block structure
  415. ATAEventRec                RECORD 0
  416. ataEventCode             ds.w    1                ; offset: $0 (0)        ;  --> ATA event code
  417. ataPhysicalID             ds.w    1                ; offset: $2 (2)        ;  --> Physical drive reference
  418. ataDrvrContext             ds.l    1                ; offset: $4 (4)        ;  Context pointer saved by driver
  419. ataMarker                 ds.l    1                ; offset: $8 (8)        ;  Always 'LOAD'
  420. ataEventRecVersion         ds.l    1                ; offset: $C (12)        ;  Version number of this data structure
  421. ataDeviceType             ds.l    1                ; offset: $10 (16)        ;  Device type on bus (valid for load driver only)
  422. ataRefNum                 ds.w    1                ; offset: $14 (20)        ;  RefNum of driver (valid for remove driver only)
  423. sizeof                     EQU *                    ; size:   $16 (22)
  424.                         ENDR
  425. ; typedef struct ATAEventRec *            ATAEventRecPtr
  426.  
  427. ;  Parameter block structure for Driver Register command
  428. ;  Manager parameter block structure
  429. ataDrvrRegister            RECORD 0
  430. ;  Start of cloned common header ataPBHdr
  431. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  432. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  433. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  434. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  435. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  436. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  437. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  438. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  439. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  440. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  441. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  442. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  443. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  444. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  445. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  446. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  447. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  448. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  449. ;  End of cloned common header ataPBHdr
  450. ataDrvrRefNum             ds.w    1                ; offset: $30 (48)        ;  <->: Driver reference number
  451. ataDrvrFlags             ds.w    1                ; offset: $32 (50)        ;  -->: 1 = loader driver if ataPBDeviceID = -1 {PB2}
  452. ataDeviceNextID             ds.w    1                ; offset: $34 (52)        ;  <--: used to specified the next drive ID
  453. ataDrvrLoadPriv             ds.w    1                ; offset: $36 (54)        ;  Driver loader private storage
  454. ataEventHandler             ds.l    1                ; offset: $38 (56)        ;  <->: Pointer to ATA event callback routine {PB2}
  455. ataDrvrContext             ds.l    1                ; offset: $3C (60)        ;  <->: Context data saved by driver {PB2}
  456. ataEventMask             ds.l    1                ; offset: $40 (64)        ;  <->: Set to 1 for notification of event {PB2}
  457. Reserved                 ds.w    14                ; offset: $44 (68)        ;  Reserved for future expansion - from [21] {PB2}
  458. sizeof                     EQU *                    ; size:   $60 (96)
  459.                         ENDR
  460. ;  Parameter block structure for Modify driver event mask command
  461. ataModifyEventMask        RECORD 0
  462. ;  Start of cloned common header ataPBHdr
  463. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  464. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  465. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  466. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  467. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  468. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  469. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  470. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  471. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  472. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  473. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  474. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  475. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  476. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  477. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  478. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  479. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  480. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  481. ;  End of cloned common header ataPBHdr
  482. ataModifiedEventMask     ds.l    1                ; offset: $30 (48)        ;  -->: new event mask value
  483. Reserved                 ds.w    22                ; offset: $34 (52)        ;  Reserved for future expansion
  484. sizeof                     EQU *                    ; size:   $60 (96)
  485.                         ENDR
  486. ;  'ataRegMask' field of the ataRegAccess definition
  487.  
  488. bATAAltSDevCValid                EQU        14                    ; bit number of alternate status/device cntrl valid bit
  489. bATAStatusCmdValid                EQU        7                    ; bit number of status/command valid bit
  490. bATASDHValid                    EQU        6                    ; bit number of ataTFSDH valid bit
  491. bATACylinderHiValid                EQU        5                    ; bit number of cylinder high valid bit
  492. bATACylinderLoValid                EQU        4                    ; bit number of cylinder low valid bit
  493. bATASectorNumValid                EQU        3                    ; bit number of sector number valid bit
  494. bATASectorCntValid                EQU        2                    ; bit number of sector count valid bit
  495. bATAErrFeaturesValid            EQU        1                    ; bit number of error/features valid bit
  496. bATADataValid                    EQU        0                    ; bit number of data valid bit
  497. mATAAltSDevCValid                EQU        $4000                ; alternate status/device control valid
  498. mATAStatusCmdValid                EQU        $80                    ; status/command valid
  499. mATASDHValid                    EQU        $40                    ; ataTFSDH valid
  500. mATACylinderHiValid                EQU        $20                    ; cylinder high valid
  501. mATACylinderLoValid                EQU        $10                    ; cylinder low valid
  502. mATASectorNumValid                EQU        $08                    ; sector number valid
  503. mATASectorCntValid                EQU        $04                    ; sector count valid
  504. mATAErrFeaturesValid            EQU        $02                    ; error/features valid
  505. mATADataValid                    EQU        $01                    ; data valid
  506. ;  Parameter block structure for device register access command
  507. ataRegValueUnion        RECORD 0
  508. ataByteRegValue             ds.b    1                ; offset: $0 (0)        ;  <->: Byte register value read or to be written
  509.                          ORG 0
  510. ataWordRegValue             ds.w    1                ; offset: $0 (0)        ;  <->: Word register value read or to be written
  511. sizeof                     EQU *                    ; size:   $2 (2)
  512.                         ENDR
  513. ;  Manager parameter block structure
  514. ataRegAccess            RECORD 0
  515. ;  Start of cloned common header ataPBHdr
  516. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  517. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  518. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  519. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  520. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  521. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  522. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  523. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  524. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  525. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  526. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  527. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  528. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  529. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  530. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  531. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  532. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  533. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  534. ;  End of cloned common header ataPBHdr
  535. ataRegSelect             ds.w    1                ; offset: $30 (48)        ;  -->: Device Register Selector
  536. ;             DataReg            0    
  537. ;             ErrorReg(R) or FeaturesReg(W)    1
  538. ;             SecCntReg        2
  539. ;             SecNumReg        3
  540. ;             CylLoReg        4
  541. ;             CylHiReg        5
  542. ;             SDHReg            6
  543. ;             StatusReg(R) or CmdReg(W)        7
  544. ;             AltStatus(R) or DevCntr(W)    0E
  545. ataRegValue                 ds        ataRegValueUnion ; offset: $32 (50)
  546. ;  Following fields are valid only if ataRegSelect = 0xFFFF
  547. ataRegMask                 ds.w    1                ; offset: $34 (52)        ;  -->: mask for register(s) to update
  548. ;         bit 0 : data register valid
  549. ;         bit 1 : error/feaures register valid
  550. ;         bit 2 : sector count register valid
  551. ;         bit 3 : sector number register valid
  552. ;         bit 4 : cylinder low register valid
  553. ;         bit 5 : cylinder high register valid
  554. ;         bit 6 : ataTFSDH register valid
  555. ;         bit 7 : status/command register valid
  556. ;         bits 8 - 13 : reserved (set to 0)
  557. ;         bit 14: alternate status / device control reg valid
  558. ;          bit 15: reserved (set to 0)
  559. ataRegisterImage         ds        ataTaskFile        ; offset: $36 (54)        ;  <->: register images
  560. ataAltSDevCReg             ds.b    1                ; offset: $3E (62)        ;  <->: Alternate status(R) or Device Control(W) register image
  561. Reserved3                 ds.b    1                ; offset: $3F (63)        ;  Reserved
  562. Reserved                 ds.w    16                ; offset: $40 (64)        ;  Reserved for future expansion
  563. sizeof                     EQU *                    ; size:   $60 (96)
  564.                         ENDR
  565. ;  Manager parameter block structure    <DP03/10/94>
  566. ataIdentify                RECORD 0
  567. ;  Start of cloned common header ataPBHdr
  568. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  569. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  570. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  571. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  572. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  573. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  574. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  575. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  576. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  577. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  578. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  579. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  580. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  581. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  582. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  583. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  584. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  585. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  586. ;  End of cloned common header ataPBHdr
  587. Reserved1                 ds.w    4                ; offset: $30 (48)        ;  Reserved.  These are used internally by the Manager
  588. ataPBBuffer                 ds.l    1                ; offset: $38 (56)        ;  Buffer for the identify data (512 bytes)
  589. Reserved2                 ds.w    12                ; offset: $3C (60)        ;  Used internally by the ATA Manager
  590. Reserved3                 ds.w    6                ; offset: $54 (84)        ;  Reserved for future expansion
  591. sizeof                     EQU *                    ; size:   $60 (96)
  592.                         ENDR
  593. ;  'ataConfigSetting' field of the Get/Set Device Configuration definition <8/6/94>
  594.  
  595. ATAPIpacketDRQ_bit                EQU        6                    ; bit number of ATAPI command packet DRQ option
  596. ATAPIpacketDRQ                    EQU        $40                    ; ATAPI command packet DRQ option
  597. ;  atapcValid field definition
  598.  
  599. bATApcAccessMode                EQU        0
  600. bATApcVcc                        EQU        1
  601. bATApcVpp1                        EQU        2
  602. bATApcVpp2                        EQU        3
  603. bATApcStatus                    EQU        4
  604. bATApcPin                        EQU        5
  605. bATApcCopy                        EQU        6
  606. bATApcConfigIndex                EQU        7
  607. bATApcLockUnlock                EQU        15
  608. mATApcAccessMode                EQU        $01
  609. mATApcVcc                        EQU        $02
  610. mATApcVpp1                        EQU        $04
  611. mATApcVpp2                        EQU        $08
  612. mATApcStatus                    EQU        $10
  613. mATApcPin                        EQU        $20
  614. mATApcCopy                        EQU        $40
  615. mATApcConfigIndex                EQU        $80
  616. mATApcLockUnlock                EQU        $8000
  617. ;  Device physical type & socket type indicator definition
  618.  
  619. kATADeviceUnknown                EQU        $00                    ; no device or type undetermined
  620. kATADeviceATA                    EQU        $01                    ; traditional ATA protocol device <7/29/94>
  621. kATADeviceATAPI                    EQU        $02                    ; ATAPI protocol device    <7/29/94>
  622. kATADeviceReserved                EQU        $03                    ; reserved by Apple (was PCMCIA)
  623.  
  624. kATASocketInternal                EQU        $01                    ; Internal ATA socket
  625. kATASocketMB                    EQU        $02                    ; Media Bay socket
  626. kATASocketPCMCIA                EQU        $03                    ; PCMCIA socket
  627. ;  reserved words at the end of the devConfig structure
  628.  
  629. kATAConfigReserved                EQU        7                    ; number of reserved words at the end
  630.  
  631. ;   Get/Set Device Configuration parameter block structure <8/6/94>
  632. ;   Manager parameter block structure
  633.  
  634.  
  635. ataDevConfiguration        RECORD 0
  636. ;  Start of cloned common header ataPBHdr
  637. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  638. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  639. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  640. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  641. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  642. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  643. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  644. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  645. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  646. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  647. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  648. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  649. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  650. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  651. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  652. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  653. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  654. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  655. ;  End of cloned common header ataPBHdr
  656. ataConfigSetting         ds.l    1                ; offset: $30 (48)        ;  <->: Configuration setting
  657. ;       Bits 3 - 0: Reserved
  658. ;       Bit 4: Reserved (allowLBAAccess)
  659. ;       Bit 5: Reserved (allowRWMultiple)
  660. ;       Bit 6: ATAPIpacketDRQ
  661. ;         1 = Check for Interrupt DRQ on ATAPI command packet DRQ
  662. ;         0 = Default: Check only for the assertion of command packet DRQ
  663. ;       Bits 31 - 7: Reserved
  664. ataPIOSpeedMode             ds.b    1                ; offset: $34 (52)        ;  <->: Device access speed in PIO Mode
  665. Reserved3                 ds.b    1                ; offset: $35 (53)        ;  Reserved to force word alignment
  666. atapcValid                 ds.w    1                ; offset: $36 (54)        ;  <->: Set when pcXXX fields are valid (atapcAccessMode - atapcConfigIndex)
  667. ;         bit 0 - atapcAccessMode field valid, when set
  668. ;         bit 1 - atapcVcc field valid, when set
  669. ;         bit 2 - atapcVpp1 field valid, when set
  670. ;         bit 3 - atapcVpp2 field valid, when set
  671. ;         bit 4 - atapcStatus field valid, when set
  672. ;         bit 5 - atapcPin field valid, when set
  673. ;         bit 6 - atapcCopy field valid, when set
  674. ;         bit 7 - atapcConfigIndex field valid, when set
  675. ;         bits 14-8 - Reserved
  676. ;         bit 15 - device lock/unlock request (write only)
  677. ataRWMultipleCount         ds.w    1                ; offset: $38 (56)        ;  Reserved for future (not supported yet)
  678. ataSectorsPerCylinder     ds.w    1                ; offset: $3A (58)        ;  Reserved for future (not supported yet)
  679. ataHeads                 ds.w    1                ; offset: $3C (60)        ;  Reserved for future (not supported yet)
  680. ataSectorsPerTrack         ds.w    1                ; offset: $3E (62)        ;  Reserved for future (not supported yet)
  681. ataSocketNumber             ds.w    1                ; offset: $40 (64)        ;  <--: Socket number used by the CardServices
  682. ;         0xFF = socket number invalid (Not a CardServices device)
  683. ;         other = socket number of the device
  684. ataSocketType             ds.b    1                ; offset: $42 (66)        ;  <--: Specifies the socket type (get config only)
  685. ;         00 = Unknown socket
  686. ;          01 = Internal ATA bus
  687. ;         02 = Media Bay
  688. ;         03 = PCMCIA
  689. ataDeviceType             ds.b    1                ; offset: $43 (67)        ;  <--: Specifies the device type (get config only)
  690. ;         00 = Unknown device
  691. ;         01 = standard ATA device (HD)
  692. ;         02 = ATAPI device
  693. ;         03 = PCMCIA ATA device
  694. atapcAccessMode             ds.b    1                ; offset: $44 (68)        ;  <->: Access mode: Memory vs. I/O (PCMCIA only)
  695. atapcVcc                 ds.b    1                ; offset: $45 (69)        ;  <->: Voltage in tenths of a volt (PCMCIA only)
  696. atapcVpp1                 ds.b    1                ; offset: $46 (70)        ;  <->: Voltage in tenths of a volt (PCMCIA only)
  697. atapcVpp2                 ds.b    1                ; offset: $47 (71)        ;  <->: Voltage in tenths of a volt (PCMCIA only)
  698. atapcStatus                 ds.b    1                ; offset: $48 (72)        ;  <->: Card Status register setting (PCMCIA only)
  699. atapcPin                 ds.b    1                ; offset: $49 (73)        ;  <->: Card Pin register setting (PCMCIA only)
  700. atapcCopy                 ds.b    1                ; offset: $4A (74)        ;  <->: Card Socket/Copy register setting (PCMCIA only)
  701. atapcConfigIndex         ds.b    1                ; offset: $4B (75)        ;  <->: Card Option register setting (PCMCIA only)
  702. ataSingleDMASpeed         ds.b    1                ; offset: $4C (76)        ;  <->: Single Word DMA Timing Class
  703. ataMultiDMASpeed         ds.b    1                ; offset: $4D (77)        ;  <->: Multiple Word DMA Timing Class
  704. ataPIOCycleTime             ds.w    1                ; offset: $4E (78)        ;  <->:Cycle time for PIO mode
  705. ataMultiCycleTime         ds.w    1                ; offset: $50 (80)        ;  <->:Cycle time for Multiword DMA mode
  706. Reserved1                 ds.w    7                ; offset: $52 (82)        ;  Reserved for future
  707. sizeof                     EQU *                    ; size:   $60 (96)
  708.                         ENDR
  709. ;  Get Card Location Icon/Text    <SM4>
  710.  
  711. kATALargeIconHFS                EQU        $0001                ; Large B&W icon with mask (HFS)
  712. kATALargeIconProDOS                EQU        $0081                ; Large B&W icon with mask (ProDOS)
  713. ;  Manager parameter block structure
  714. ataLocationData            RECORD 0
  715. ;  Start of cloned common header ataPBHdr
  716. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  717. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  718. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  719. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  720. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  721. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  722. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  723. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  724. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  725. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  726. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  727. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  728. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  729. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  730. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  731. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  732. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  733. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  734. ;  End of cloned common header ataPBHdr
  735. ataIconType                 ds.w    1                ; offset: $30 (48)        ;  -->: icon type specifier
  736. ;          1 = Large B&W icon with mask (256 bytes)
  737. ;         0x81 = Same as 1, but ProDOS icon
  738. ataIconReserved             ds.w    1                ; offset: $32 (50)        ;  Reserved to be longword aligned
  739. ataLocationIconPtr         ds.l    1                ; offset: $34 (52)        ;  -->: Icon Data buffer pointer
  740. ataLocationStringPtr     ds.l    1                ; offset: $38 (56)        ;  -->: Icon String buffer pointer
  741. Reserved1                 ds.w    18                ; offset: $3C (60)        ;  Reserved for future
  742. sizeof                     EQU *                    ; size:   $60 (96)
  743.                         ENDR
  744. ;  ataOSType available
  745.  
  746. kATAddTypeMacOS                    EQU        $0001                ; Blue Mac O/S ddType value
  747. ;  The parameter block definition for all other ATA Manager functions.
  748.  
  749. ataGeneric                RECORD 0
  750. ;  Start of cloned common header ataPBHdr
  751. ataPBLink                 ds.l    1                ; offset: $0 (0)        ;  a pointer to the next entry in the queue    
  752. ataPBQType                 ds.w    1                ; offset: $4 (4)        ;  type byte for safety check
  753. ataPBVers                 ds.b    1                ; offset: $6 (6)        ;  -->: parameter block version number; Must be 0x01
  754. ataPBReserved             ds.b    1                ; offset: $7 (7)        ;  Reserved                                        
  755. ataPBReserved2             ds.l    1                ; offset: $8 (8)        ;  Reserved                                        
  756. ataPBCallbackPtr         ds.l    1                ; offset: $C (12)        ;  -->: Completion Routine Pointer    
  757. ataPBResult                 ds.w    1                ; offset: $10 (16)        ;  <--: Returned result                
  758. ataPBFunctionCode         ds.b    1                ; offset: $12 (18)        ;  -->: Manager Function Code 
  759. ataPBIOSpeed             ds.b    1                ; offset: $13 (19)        ;  -->: I/O Timing Class            
  760. ataPBFlags                 ds.w    1                ; offset: $14 (20)        ;  -->: Various control options    
  761. ataPBReserved3             ds.w    1                ; offset: $16 (22)        ;  Reserved                                        
  762. ataPBDeviceID             ds.l    1                ; offset: $18 (24)        ;  -->: Device identifier            
  763. ataPBTimeOut             ds.l    1                ; offset: $1C (28)        ;  -->: Transaction timeout value    in msec 
  764. ataPBClientPtr1             ds.l    1                ; offset: $20 (32)        ;  Client's storage Ptr 1     
  765. ataPBClientPtr2             ds.l    1                ; offset: $24 (36)        ;  Client's storage Ptr 2     
  766. ataPBState                 ds.w    1                ; offset: $28 (40)        ;  Reserved for Manager; Initialize to 0 
  767. ataPBSemaphores             ds.w    1                ; offset: $2A (42)        ;  Used internally by the manager
  768. ataPBReserved4             ds.l    1                ; offset: $2C (44)        ;  Reserved                                        
  769. ;  End of cloned common header ataPBHdr
  770. Reserved                 ds.w    24                ; offset: $30 (48)        ;  Reserved for future
  771. sizeof                     EQU *                    ; size:   $60 (96)
  772.                         ENDR
  773. ataPB                    RECORD 0
  774. ataIOParamBlock             ds        ataIOPB            ; offset: $0 (0)        ;  parameter block for I/O
  775.                          ORG 0
  776. ataBIParamBlock             ds        ataBusInquiry    ; offset: $0 (0)        ;  parameter block for bus inquiry
  777.                          ORG 0
  778. ataMIParamBlock             ds        ataMgrInquiry    ; offset: $0 (0)        ;  parameter block for Manager inquiry
  779.                          ORG 0
  780. ataAbortParamBlock         ds        ataAbort        ; offset: $0 (0)        ;  parameter block for abort
  781.                          ORG 0
  782. ataDRParamBlock             ds        ataDrvrRegister ; offset: $0 (0)        ;  parameter block for driver register
  783.                          ORG 0
  784. ataMEParamBlock             ds        ataModifyEventMask ; offset: $0 (0)        ;  parameter block for event mask modify
  785.                          ORG 0
  786. ataRAParamBlock             ds        ataRegAccess    ; offset: $0 (0)        ;  parameter block for register access
  787.                          ORG 0
  788. ataDIParamBlock             ds        ataIdentify        ; offset: $0 (0)        ;  parameter block for drive identify
  789.                          ORG 0
  790. ataDCParamBlock             ds        ataDevConfiguration ; offset: $0 (0)    ;  parameter block for device configuration
  791.                          ORG 0
  792. ataLDParamBlock             ds        ataLocationData ; offset: $0 (0)        ;  parameter block for location icon data
  793. ; ataManagerInit    ataInitParamBlock;        // parameter block for Manager initialization
  794. ; ataManagerShutDn    ataSDParamBlock;        // parameter block for Manager shutdown
  795. ; ataDrvrLoad        ataDLParamBlock;        // parameter block for Driver loading
  796.                          ORG 0
  797. ataGenericParamBlock     ds        ataGeneric        ; offset: $0 (0)        ;  parameter block for all other functions
  798.                          ORG 184
  799. sizeof                     EQU *                    ; size:   $B8 (184)
  800.                         ENDR
  801. ;  The ATA Event codes…
  802.  
  803. kATANullEvent                    EQU        $00                    ; Just kidding -- nothing happened
  804. kATAOnlineEvent                    EQU        $01                    ; An ATA device has come online
  805. kATAOfflineEvent                EQU        $02                    ; An ATA device has gone offline
  806. kATARemovedEvent                EQU        $03                    ; An ATA device has been removed from the bus
  807. kATAResetEvent                    EQU        $04                    ; Someone gave a hard reset to the drive
  808. kATAOfflineRequest                EQU        $05                    ; Someone requesting to offline the drive
  809. kATAEjectRequest                EQU        $06                    ; Someone requesting to eject the drive
  810. kATAUpdateEvent                    EQU        $07                    ; Potential configuration change reported by CardServices <SM4>
  811. kATATaskTimeRequest                EQU        $08                    ; The manager is requesting to be called at Task Time
  812. kATALoadDriverNow                EQU        $09                    ; Load the driver for the given bus immediately
  813.                                                             ; The following describes bit definitions in the eventMask field of ataDrvrRegister
  814. bATANullEvent                    EQU        $01                    ; null event bit
  815. bATAOnlineEvent                    EQU        $02                    ; online event bit
  816. bATAOfflineEvent                EQU        $04                    ; offline event bit
  817. bATARemovedEvent                EQU        $08                    ; removed event bit
  818. bATAResetEvent                    EQU        $10                    ; reset event bit
  819. bATAOfflineRequest                EQU        $20                    ; offline request event bit
  820. bATAEjectRequest                EQU        $40                    ; eject request event bit
  821. bATAUpdateEvent                    EQU        $80                    ; configuration update event bit
  822.  
  823. kATAEventMarker                    EQU        'LOAD'                ; Marker for the event data structure
  824. kATAEventVersion1                EQU        $00000001            ; Version 1 of the event structure
  825. ;
  826. ; pascal SInt16 ataManager(ataPB *pb)
  827. ;
  828.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  829.         _ataManager:    OPWORD    $AAF1
  830.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  831.         IMPORT_CFM_FUNCTION ataManager
  832.     ENDIF
  833.  
  834. ;  Device Error codes: 0xDB42 - 0xDB5F    
  835.  
  836.  
  837. ATABaseErrCode                    EQU        -9406                ; Base error code - 0xDB42    
  838. ioPending                        EQU        1                    ; Asynch I/O in progress status
  839. AT_NRdyErr                        EQU        -9405                ; 0xDB43: Drive not Ready 
  840. AT_IDNFErr                        EQU        -9404                ; 0xDB44: ID not found 
  841. AT_DMarkErr                        EQU        -9403                ; 0xDB45: Data mark not found 
  842. AT_BadBlkErr                    EQU        -9402                ; 0xDB46: Bad Block 
  843. AT_CorDataErr                    EQU        -9401                ; 0xDB47: Data was corrected 
  844. AT_UncDataErr                    EQU        -9400                ; 0xDB48: Data was not corrected 
  845. AT_SeekErr                        EQU        -9399                ; 0xDB49: Seek error 
  846. AT_WrFltErr                        EQU        -9398                ; 0xDB4A: Write fault 
  847. AT_RecalErr                        EQU        -9397                ; 0xDB4B: Recalibrate failed 
  848. AT_AbortErr                        EQU        -9396                ; 0xDB4C: Command aborted by drive 
  849. AT_MCErr                        EQU        -9394                ; 0xDB4E: Media Changed error
  850. ATAPICheckErr                    EQU        -9393                ; 0xDB4F: ATAPI Check condition <06/15/94>
  851.                                                             ; System error codes...Custom Driver Error Codes 0xDB60 - 0xDB6F
  852. DRVRCantAllocate                EQU        -9376                ; 0xDB60: Allocation error during initialization
  853. NoATAMgr                        EQU        -9375                ; 0xDB61: MgrInquiry failed => No ATA Manager
  854. ATAInitFail                        EQU        -9374                ; 0xDB62: Mgr Initialization failed
  855. ATABufFail                        EQU        -9373                ; 0xDB63: Device buffer test failure
  856. ATADevUnsupported                EQU        -9372                ; 0xDB64: Device type not supported
  857. ATAEjectDrvErr                    EQU        -9371                ; 0xDB65: Could not eject the drive
  858.                                                             ; Manager Error Codes 0xDB70 - 0xDB8F
  859. ATAMgrNotInitialized            EQU        -9360                ; 0xDB70: Mgr has not been initialized
  860. ATAPBInvalid                    EQU        -9359                ; 0xDB71: The bus base address couldn't be found
  861. ATAFuncNotSupported                EQU        -9358                ; 0xDB72: An unknown function code specified
  862. ATABusy                            EQU        -9357                ; 0xDB73: Selected device is busy
  863. ATATransTimeOut                    EQU        -9356                ; 0xDB74: Transaction timeout detected
  864. ATAReqInProg                    EQU        -9355                ; 0xDB75: Channel busy; channel is processing another cmd
  865. ATAUnknownState                    EQU        -9354                ; 0xDB76: Device status register reflects an unknown state
  866. ATAQLocked                        EQU        -9353                ; 0xDB77: I/O Queue is locked due to previous I/O error.
  867. ATAReqAborted                    EQU        -9352                ; 0xDB78: The I/O queue entry was aborted due to an abort req.
  868.                                                             ;            or due to Manager shutdown.
  869. ATAUnableToAbort                EQU        -9351                ; 0xDB79: The I/O queue entry could not be aborted.
  870. ATAAbortedDueToRst                EQU        -9350                ; 0xDB7A: Request aborted due to a device reset command.
  871. ATAPIPhaseErr                    EQU        -9349                ; 0xDB7B: Unexpected phase - •••IS THIS VALID ERROR??? <06/15/94>
  872. ATAPITxCntErr                    EQU        -9348                ; 0xDB7C: Overrun/Underrun condition detected
  873. ATANoClientErr                    EQU        -9347                ; 0xDB7D: No client present to handle the event
  874. ATAInternalErr                    EQU        -9346                ; 0xDB7E: MagnumOpus returned an error
  875. ATABusErr                        EQU        -9345                ; 0xDB7F: Bus error detected on I/O    
  876. AT_NoAddrErr                    EQU        -9344                ; 0xDB80: Invalid AT base adress 
  877. DriverLocked                    EQU        -9343                ; 0xDB81: Current driver must be removed before adding another
  878. CantHandleEvent                    EQU        -9342                ; 0xDB82: Particular event couldn't be handled (call others)
  879. ATAMgrMemoryErr                    EQU        -9341                ; 0xDB83: Manager memory allocation error    
  880. ATASDFailErr                    EQU        -9340                ; 0xDB84: Shutdown failure                
  881. ATAXferParamErr                    EQU        -9339                ; 0xDB85: I/O xfer parameters inconsistent 
  882. ATAXferModeErr                    EQU        -9338                ; 0xDB86: I/O xfer mode not supported 
  883. ATAMgrConsistencyErr            EQU        -9337                ; 0XDB87: Manager detected internal inconsistency. 
  884. ATADmaXferErr                    EQU        -9336                ; 0XDB88: fatal error in DMA side of transfer 
  885.                                                             ; Driver loader error Codes 0xDB90 - 0xDBA5
  886. ATAInvalidDrvNum                EQU        -9328                ; 0xDB90: Invalid drive number from event
  887. ATAMemoryErr                    EQU        -9327                ; 0xDB91: Memory allocation error
  888. ATANoDDMErr                        EQU        -9326                ; 0xDB92: No DDM found on media    
  889. ATANoDriverErr                    EQU        -9325                ; 0xDB93: No driver found on the media    
  890. ;  ------------------------    Version 1 definition -------------------------------    
  891.  
  892. v1ATABaseErrCode                EQU        $0700                ; This needs a home somewhere
  893. v1AT_NRdyErr                    EQU        $FFFFF901            ; 0xF901: -0x1DBE 
  894. v1AT_IDNFErr                    EQU        $FFFFF904            ; 0xF904: -0x1DC0 
  895. v1AT_DMarkErr                    EQU        $FFFFF905            ; 0xF905: -0x1DC0 
  896. v1AT_BadBlkErr                    EQU        $FFFFF906            ; 0xF906: -0x1DC0 
  897. v1AT_CorDataErr                    EQU        $FFFFF907            ; 0xF907: -0x1DC0 
  898. v1AT_UncDataErr                    EQU        $FFFFF908            ; 0xF908: -0x1DC0 
  899. v1AT_SeekErr                    EQU        $FFFFF909            ; 0xF909: -0x1DC0 
  900. v1AT_WrFltErr                    EQU        $FFFFF90A            ; 0xF90A: -0x1DC0 
  901. v1AT_RecalErr                    EQU        $FFFFF90B            ; 0xF90B: -0x1DC0 
  902. v1AT_AbortErr                    EQU        $FFFFF90C            ; 0xF90C: -0x1DC0 
  903. v1AT_NoAddrErr                    EQU        $FFFFF90D            ; 0xF90D: -0x1D8D 
  904. v1AT_MCErr                        EQU        $FFFFF90E            ; 0xF90E: -0x1DC0
  905.                                                             ; System error codes...Custom Driver Error Codes
  906. v1DRVRCantAllocate                EQU        -1793                ; 0xF8FF: -0x1D9F
  907. v1NoATAMgr                        EQU        -1794                ; 0xF8FE: -0x1D9D
  908. v1ATAInitFail                    EQU        -1795                ; 0xF8FD: -0x1D9B
  909. v1ATABufFail                    EQU        -1796                ; 0xF8FC: -0x1D99
  910. v1ATADevUnsupported                EQU        -1797                ; 0xF8FB: -0x1c97
  911.                                                             ; Manager Error Codes
  912. v1ATAMgrNotInitialized            EQU        -1802                ; 0xF8F6: -0x1D86
  913. v1ATAPBInvalid                    EQU        -1803                ; 0xF8F5: -0x1D84
  914. v1ATAFuncNotSupported            EQU        -1804                ; 0xF8F4: -0x1D82
  915. v1ATABusy                        EQU        -1805                ; 0xF8F3: -0x1D80
  916. v1ATATransTimeOut                EQU        -1806                ; 0xF8F2: -0x1D7E
  917. v1ATAReqInProg                    EQU        -1807                ; 0xF8F1: -0x1D7C
  918. v1ATAUnknownState                EQU        -1808                ; 0xF8F0: -0x1D7A
  919. v1ATAQLocked                    EQU        -1809                ; 0xF8EF: -0x1D78
  920. v1ATAReqAborted                    EQU        -1810                ; 0xF8EE: -0x1D76
  921. v1ATAUnableToAbort                EQU        -1811                ; 0xF8ED: -0x1D74
  922. v1ATAAbortedDueToRst            EQU        -1812                ; 0xF8EC: -0x1D72
  923.  
  924.     ENDIF ; __ATA__ 
  925.  
  926.